home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / fp.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  35.8 KB  |  1,359 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        fp.a
  3. ;
  4. ;    Contains:    FPCE Floating-Point Definitions and Declarations.
  5. ;
  6. ;    Version:    Technology:    MathLib v2
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1987-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__FP__') = 'UNDEFINED' THEN
  19. __FP__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.  
  25.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  26.     include 'Types.a'
  27.     ENDIF
  28. ; ********************************************************************************
  29. ;*                                                                               *
  30. ;*    A collection of numerical functions designed to facilitate a wide          *
  31. ;*    range of numerical programming as required by C9X.                         *
  32. ;*                                                                               *
  33. ;*    The <fp.h> declares many functions in support of numerical programming.    *
  34. ;*    It provides a superset of <math.h> and <SANE.h> functions.  Some           *
  35. ;*    functionality previously found in <SANE.h> and not in the FPCE <fp.h>      *
  36. ;*    can be found in this <fp.h> under the heading "__NOEXTENSIONS__".          *
  37. ;*                                                                               *
  38. ;*    All of these functions are IEEE 754 aware and treat exceptions, NaNs,      *
  39. ;*    positive and negative zero and infinity consistent with the floating-      *
  40. ;*    point standard.                                                            *
  41. ;*                                                                               *
  42. ;*******************************************************************************
  43.  
  44.  
  45. ; ********************************************************************************
  46. ;*                                                                               *
  47. ;*                            Efficient types                                    *
  48. ;*                                                                               *
  49. ;*    float_t         Most efficient type at least as wide as float              *
  50. ;*    double_t        Most efficient type at least as wide as double             *
  51. ;*                                                                               *
  52. ;*      CPU            float_t(bits)                double_t(bits)               *
  53. ;*    --------        -----------------            -----------------             *
  54. ;*    PowerPC          float(32)                    double(64)                   *
  55. ;*    68K              long double(80/96)           long double(80/96)           *
  56. ;*                                                                               *
  57. ;*******************************************************************************
  58.  
  59.     IF TARGET_CPU_PPC THEN
  60. ; typedef float                         float_t
  61.  
  62. ; typedef double                         double_t
  63.  
  64.     ELSEIF TARGET_CPU_68K THEN
  65. ; typedef long double                     float_t
  66.  
  67. ; typedef long double                     double_t
  68.  
  69.     ELSE
  70.     ENDIF    ; TARGET_CPU_68K
  71.  
  72. ; ********************************************************************************
  73. ;*                                                                               *
  74. ;*                              Define some constants.                           *
  75. ;*                                                                               *
  76. ;*    HUGE_VAL            IEEE 754 value of infinity.                            *
  77. ;*    INFINITY            IEEE 754 value of infinity.                            *
  78. ;*    NAN                 A generic NaN (Not A Number).                          *
  79. ;*    DECIMAL_DIG         Satisfies the constraint that the conversion from      *
  80. ;*                        double to decimal and back is the identity function.   *
  81. ;*                                                                               *
  82. ;*******************************************************************************
  83.  
  84.  
  85. ; ********************************************************************************
  86. ;*                                                                               *
  87. ;*                            Trigonometric functions                            *
  88. ;*                                                                               *
  89. ;*   acos        result is in [0,pi].                                            *
  90. ;*   asin        result is in [-pi/2,pi/2].                                      *
  91. ;*   atan        result is in [-pi/2,pi/2].                                      *
  92. ;*   atan2       Computes the arc tangent of y/x in [-pi,pi] using the sign of   *
  93. ;*               both arguments to determine the quadrant of the computed value. *
  94. ;*                                                                               *
  95. ;*******************************************************************************
  96.  
  97. ;
  98. ; extern double_t cos(double_t x)
  99. ;
  100.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  101.         IMPORT_CFM_FUNCTION cos
  102.     ENDIF
  103.  
  104. ;
  105. ; extern double_t sin(double_t x)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  108.         IMPORT_CFM_FUNCTION sin
  109.     ENDIF
  110.  
  111. ;
  112. ; extern double_t tan(double_t x)
  113. ;
  114.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  115.         IMPORT_CFM_FUNCTION tan
  116.     ENDIF
  117.  
  118. ;
  119. ; extern double_t acos(double_t x)
  120. ;
  121.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  122.         IMPORT_CFM_FUNCTION acos
  123.     ENDIF
  124.  
  125. ;
  126. ; extern double_t asin(double_t x)
  127. ;
  128.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  129.         IMPORT_CFM_FUNCTION asin
  130.     ENDIF
  131.  
  132. ;
  133. ; extern double_t atan(double_t x)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  136.         IMPORT_CFM_FUNCTION atan
  137.     ENDIF
  138.  
  139. ;
  140. ; extern double_t atan2(double_t y, double_t x)
  141. ;
  142.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  143.         IMPORT_CFM_FUNCTION atan2
  144.     ENDIF
  145.  
  146.  
  147.  
  148. ; ********************************************************************************
  149. ;*                                                                                *
  150. ;*                              Hyperbolic functions                             *
  151. ;*                                                                                *
  152. ;*******************************************************************************
  153.  
  154. ;
  155. ; extern double_t cosh(double_t x)
  156. ;
  157.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION cosh
  159.     ENDIF
  160.  
  161. ;
  162. ; extern double_t sinh(double_t x)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  165.         IMPORT_CFM_FUNCTION sinh
  166.     ENDIF
  167.  
  168. ;
  169. ; extern double_t tanh(double_t x)
  170. ;
  171.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION tanh
  173.     ENDIF
  174.  
  175. ;
  176. ; extern double_t acosh(double_t x)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION acosh
  180.     ENDIF
  181.  
  182. ;
  183. ; extern double_t asinh(double_t x)
  184. ;
  185.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION asinh
  187.     ENDIF
  188.  
  189. ;
  190. ; extern double_t atanh(double_t x)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  193.         IMPORT_CFM_FUNCTION atanh
  194.     ENDIF
  195.  
  196.  
  197.  
  198. ; ********************************************************************************
  199. ;*                                                                                *
  200. ;*                              Exponential functions                               *
  201. ;*                                                                                *
  202. ;*    expm1        expm1(x) = exp(x) - 1.  But, for small enough arguments,          *
  203. ;*                expm1(x) is expected to be more accurate than exp(x) - 1.        *
  204. ;*    frexp        Breaks a floating-point number into a normalized fraction       *
  205. ;*                and an integral power of 2.  It stores the integer in the       *
  206. ;*                object pointed by *exponent.                                    *
  207. ;*    ldexp        Multiplies a floating-point    number by an integer power of 2.    *
  208. ;*    log1p        log1p = log(1 + x). But, for small enough arguments,              *
  209. ;*                 log1p is expected to be more accurate than log(1 + x).          *
  210. ;*    logb        Extracts the exponent of its argument, as a signed integral        *
  211. ;*                  value. A subnormal argument is treated as though it were first    *
  212. ;*                  normalized. Thus:                                                *
  213. ;*                                     1   <=   x * 2^(-logb(x))   <   2             *
  214. ;*    modf        Returns fractional part of x as function result and returns     *
  215. ;*                integral part of x via iptr. Note C9X uses double not double_t.    *
  216. ;*    scalb        Computes x * 2^n efficently.  This is not normally done by        *
  217. ;*                  computing 2^n explicitly.                                         *
  218. ;*                                                                                *
  219. ;*******************************************************************************
  220.  
  221. ;
  222. ; extern double_t exp(double_t x)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION exp
  226.     ENDIF
  227.  
  228. ;
  229. ; extern double_t expm1(double_t x)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  232.         IMPORT_CFM_FUNCTION expm1
  233.     ENDIF
  234.  
  235. ;
  236. ; extern double_t exp2(double_t x)
  237. ;
  238.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  239.         IMPORT_CFM_FUNCTION exp2
  240.     ENDIF
  241.  
  242. ;
  243. ; extern double_t frexp(double_t x, int *exponent)
  244. ;
  245.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION frexp
  247.     ENDIF
  248.  
  249. ;
  250. ; extern double_t ldexp(double_t x, int n)
  251. ;
  252.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION ldexp
  254.     ENDIF
  255.  
  256. ;
  257. ; extern double_t log(double_t x)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  260.         IMPORT_CFM_FUNCTION log
  261.     ENDIF
  262.  
  263. ;
  264. ; extern double_t log2(double_t x)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION log2
  268.     ENDIF
  269.  
  270. ;
  271. ; extern double_t log1p(double_t x)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION log1p
  275.     ENDIF
  276.  
  277. ;
  278. ; extern double_t log10(double_t x)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION log10
  282.     ENDIF
  283.  
  284. ;
  285. ; extern double_t logb(double_t x)
  286. ;
  287.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  288.         IMPORT_CFM_FUNCTION logb
  289.     ENDIF
  290.  
  291. ;
  292. ; extern double_t modf(double_t x, double_t *iptr)
  293. ;
  294.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  295.         IMPORT_CFM_FUNCTION modf
  296.     ENDIF
  297.  
  298. ;
  299. ; extern float modff(float x, float *iptrf)
  300. ;
  301.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION modff
  303.     ENDIF
  304.  
  305. ;
  306. ; extern double_t scalb(double_t x, long n)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION scalb
  310.     ENDIF
  311.  
  312.  
  313.  
  314. ; ********************************************************************************
  315. ;*                                                                                *
  316. ;*                     Power and absolute value functions                          *
  317. ;*                                                                                *
  318. ;*    hypot        Computes the square root of the sum of the squares of its        *
  319. ;*                  arguments, without undue overflow or underflow.                 *
  320. ;*    pow            Returns x raised to the power of y.  Result is more accurate    *
  321. ;*                than using exp(log(x)*y).                                        *
  322. ;*                                                                                *
  323. ;*******************************************************************************
  324.  
  325. ;
  326. ; extern double_t fabs(double_t x)
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION fabs
  330.     ENDIF
  331.  
  332. ;
  333. ; extern double_t hypot(double_t x, double_t y)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION hypot
  337.     ENDIF
  338.  
  339. ;
  340. ; extern double_t pow(double_t x, double_t y)
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  343.         IMPORT_CFM_FUNCTION pow
  344.     ENDIF
  345.  
  346. ;
  347. ; extern double_t sqrt(double_t x)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  350.         IMPORT_CFM_FUNCTION sqrt
  351.     ENDIF
  352.  
  353.  
  354.  
  355. ; ********************************************************************************
  356. ;*                                                                                 *
  357. ;*                        Gamma and Error functions                               *
  358. ;*                                                                                 *
  359. ;*     erf            The error function.                                             *
  360. ;*     erfc        Complementary error function.                                      *
  361. ;*     gamma        The gamma function.                                                *
  362. ;*     lgamma        Computes the base-e logarithm of the absolute value of            *
  363. ;*                 gamma of its argument x, for x > 0.                                *
  364. ;*                                                                                 *
  365. ;*******************************************************************************
  366.  
  367. ;
  368. ; extern double_t erf(double_t x)
  369. ;
  370.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  371.         IMPORT_CFM_FUNCTION erf
  372.     ENDIF
  373.  
  374. ;
  375. ; extern double_t erfc(double_t x)
  376. ;
  377.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  378.         IMPORT_CFM_FUNCTION erfc
  379.     ENDIF
  380.  
  381. ;
  382. ; extern double_t gamma(double_t x)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  385.         IMPORT_CFM_FUNCTION gamma
  386.     ENDIF
  387.  
  388. ;
  389. ; extern double_t lgamma(double_t x)
  390. ;
  391.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  392.         IMPORT_CFM_FUNCTION lgamma
  393.     ENDIF
  394.  
  395.  
  396.  
  397. ; ********************************************************************************
  398. ;*                                                                                 *
  399. ;*                        Nearest integer functions                                 *
  400. ;*                                                                                 *
  401. ;*     rint        Rounds its argument to an integral value in floating point         *
  402. ;*                  format, honoring the current rounding direction.                   *
  403. ;*                                                                                 *
  404. ;*     nearbyint    Differs from rint only in that it does not raise the inexact    *
  405. ;*               exception. It is the nearbyint function recommended by the        *
  406. ;*                  IEEE floating-point standard 854.                                  *
  407. ;*                                                                                 *
  408. ;*     rinttol        Rounds its argument to the nearest long int using the current     *
  409. ;*                  rounding direction.  NOTE: if the rounded value is outside        *
  410. ;*                the range of long int, then the result is undefined.              *
  411. ;*                                                                                  *
  412. ;*     round        Rounds the argument to the nearest integral value in floating     *
  413. ;*                  point format similar to the Fortran "anint" function. That is:  *
  414. ;*                  add half to the magnitude and chop.                             *
  415. ;*                                                                                 *
  416. ;*     roundtol    Similar to the Fortran function nint or to the Pascal round.    *
  417. ;*                 NOTE: if the rounded value is outside the range of long int,    *
  418. ;*                  then the result is undefined.                                      *
  419. ;*                                                                                 *
  420. ;*     trunc        Computes the integral value, in floating format, nearest to        *
  421. ;*                 but no larger in magnitude than its argument.      NOTE: on 68K    *
  422. ;*                compilers when using -elems881, trunc must return an int        *
  423. ;*                                                                                 *
  424. ;*******************************************************************************
  425.  
  426. ;
  427. ; extern double_t ceil(double_t x)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION ceil
  431.     ENDIF
  432.  
  433. ;
  434. ; extern double_t floor(double_t x)
  435. ;
  436.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  437.         IMPORT_CFM_FUNCTION floor
  438.     ENDIF
  439.  
  440. ;
  441. ; extern double_t rint(double_t x)
  442. ;
  443.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION rint
  445.     ENDIF
  446.  
  447. ;
  448. ; extern double_t nearbyint(double_t x)
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  451.         IMPORT_CFM_FUNCTION nearbyint
  452.     ENDIF
  453.  
  454. ;
  455. ; extern long rinttol(double_t x)
  456. ;
  457.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  458.         IMPORT_CFM_FUNCTION rinttol
  459.     ENDIF
  460.  
  461. ;
  462. ; extern double_t round(double_t x)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION round
  466.     ENDIF
  467.  
  468. ;
  469. ; extern long roundtol(double_t round)
  470. ;
  471.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  472.         IMPORT_CFM_FUNCTION roundtol
  473.     ENDIF
  474.  
  475.     IF TARGET_CPU_68K THEN
  476. ;
  477. ; extern int trunc(double_t x)
  478. ;
  479.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION trunc
  481.     ENDIF
  482.  
  483.     ELSE
  484. ;
  485. ; extern double_t trunc(double_t x)
  486. ;
  487.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  488.         IMPORT_CFM_FUNCTION trunc
  489.     ENDIF
  490.  
  491.     ENDIF    ; TARGET_CPU_68K
  492.  
  493. ; ********************************************************************************
  494. ;*                                                                                 *
  495. ;*                            Remainder functions                                   *
  496. ;*                                                                                 *
  497. ;*     remainder        IEEE 754 floating point standard for remainder.                *
  498. ;*     remquo            SANE remainder.  It stores into 'quotient' the 7 low-order    *
  499. ;*                    bits of the integer quotient x/y, such that:                *
  500. ;*                        -127 <= quotient <= 127.                                 *
  501. ;*                                                                                 *
  502. ;*******************************************************************************
  503.  
  504. ;
  505. ; extern double_t fmod(double_t x, double_t y)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  508.         IMPORT_CFM_FUNCTION fmod
  509.     ENDIF
  510.  
  511. ;
  512. ; extern double_t remainder(double_t x, double_t y)
  513. ;
  514.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  515.         IMPORT_CFM_FUNCTION remainder
  516.     ENDIF
  517.  
  518. ;
  519. ; extern double_t remquo(double_t x, double_t y, int *quo)
  520. ;
  521.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  522.         IMPORT_CFM_FUNCTION remquo
  523.     ENDIF
  524.  
  525.  
  526.  
  527. ; ********************************************************************************
  528. ;*                                                                                 *
  529. ;*                             Auxiliary functions                               *
  530. ;*                                                                                 *
  531. ;*     copysign        Produces a value with the magnitude of its first argument    *
  532. ;*                      and sign of its second argument.  NOTE: the order of the     *
  533. ;*                      arguments matches the recommendation of the IEEE 754         *
  534. ;*                    floating point standard,  which is opposite from the SANE    *
  535. ;*                    copysign function.                                             *
  536. ;*                                                                                 *
  537. ;*     nan                The call 'nan("n-char-sequence")' returns a quiet NaN         *
  538. ;*                      with content indicated through tagp in the selected         *
  539. ;*                    data type format.                                              *
  540. ;*                                                                                *
  541. ;*     nextafter        Computes the next representable value after 'x' in the         *
  542. ;*                    direction of 'y'.  if x == y, then y is returned.            *
  543. ;*                                                                                 *
  544. ;*******************************************************************************
  545.  
  546. ;
  547. ; extern double_t copysign(double_t x, double_t y)
  548. ;
  549.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION copysign
  551.     ENDIF
  552.  
  553. ;
  554. ; extern double nan(const char *tagp)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION nan
  558.     ENDIF
  559.  
  560. ;
  561. ; extern float nanf(const char *tagp)
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION nanf
  565.     ENDIF
  566.  
  567. ;
  568. ; extern double nextafterd(double x, double y)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  571.         IMPORT_CFM_FUNCTION nextafterd
  572.     ENDIF
  573.  
  574. ;
  575. ; extern float nextafterf(float x, float y)
  576. ;
  577.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  578.         IMPORT_CFM_FUNCTION nextafterf
  579.     ENDIF
  580.  
  581.  
  582.  
  583. ; ********************************************************************************
  584. ;*                                                                                 *
  585. ;*                              Inquiry macros                                   *
  586. ;*                                                                                 *
  587. ;*     fpclassify        Returns one of the FP_≈ values.                                *
  588. ;*     isnormal        Non-zero if and only if the argument x is normalized.          *
  589. ;*     isfinite        Non-zero if and only if the argument x is finite.             *
  590. ;*     isnan            Non-zero if and only if the argument x is a NaN.              *
  591. ;*     signbit            Non-zero if and only if the sign of the argument x is        *
  592. ;*                      negative.  This includes, NaNs, infinities and zeros.         *
  593. ;*                                                                                 *
  594. ;*******************************************************************************
  595.  
  596.  
  597. FP_SNAN                            EQU        0                    ;      signaling NaN                         
  598. FP_QNAN                            EQU        1                    ;      quiet NaN                             
  599. FP_INFINITE                        EQU        2                    ;      + or - infinity                       
  600. FP_ZERO                            EQU        3                    ;      + or - zero                           
  601. FP_NORMAL                        EQU        4                    ;      all normal numbers                    
  602. FP_SUBNORMAL                    EQU        5                    ;      denormal numbers                      
  603. ;
  604. ; extern long __fpclassifyd(double x)
  605. ;
  606.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION __fpclassifyd
  608.     ENDIF
  609.  
  610. ;
  611. ; extern long __fpclassifyf(float x)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  614.         IMPORT_CFM_FUNCTION __fpclassifyf
  615.     ENDIF
  616.  
  617. ;
  618. ; extern long __isnormald(double x)
  619. ;
  620.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  621.         IMPORT_CFM_FUNCTION __isnormald
  622.     ENDIF
  623.  
  624. ;
  625. ; extern long __isnormalf(float x)
  626. ;
  627.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  628.         IMPORT_CFM_FUNCTION __isnormalf
  629.     ENDIF
  630.  
  631. ;
  632. ; extern long __isfinited(double x)
  633. ;
  634.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  635.         IMPORT_CFM_FUNCTION __isfinited
  636.     ENDIF
  637.  
  638. ;
  639. ; extern long __isfinitef(float x)
  640. ;
  641.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  642.         IMPORT_CFM_FUNCTION __isfinitef
  643.     ENDIF
  644.  
  645. ;
  646. ; extern long __isnand(double x)
  647. ;
  648.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  649.         IMPORT_CFM_FUNCTION __isnand
  650.     ENDIF
  651.  
  652. ;
  653. ; extern long __isnanf(float x)
  654. ;
  655.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  656.         IMPORT_CFM_FUNCTION __isnanf
  657.     ENDIF
  658.  
  659. ;
  660. ; extern long __signbitd(double x)
  661. ;
  662.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  663.         IMPORT_CFM_FUNCTION __signbitd
  664.     ENDIF
  665.  
  666. ;
  667. ; extern long __signbitf(float x)
  668. ;
  669.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  670.         IMPORT_CFM_FUNCTION __signbitf
  671.     ENDIF
  672.  
  673. ;
  674. ; extern double_t __inf(void )
  675. ;
  676.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  677.         IMPORT_CFM_FUNCTION __inf
  678.     ENDIF
  679.  
  680.  
  681.  
  682. ; ********************************************************************************
  683. ;*                                                                                 *
  684. ;*                      Max, Min and Positive Difference                         *
  685. ;*                                                                                 *
  686. ;*     fdim        Determines the 'positive difference' between its arguments:     *
  687. ;*                { x - y, if x > y }, { +0, if x <= y }.  If one argument is        *
  688. ;*                  NaN, then fdim returns that NaN.  if both arguments are NaNs,     *
  689. ;*                 then fdim returns the first argument.                            *
  690. ;*                                                                                 *
  691. ;*     fmax        Returns the maximum of the two arguments.  Corresponds to the    *
  692. ;*                max function in FORTRAN.  NaN arguments are treated as missing     *
  693. ;*                data.  If one argument is NaN and the other is a number, then     *
  694. ;*                the number is returned.  If both are NaNs then the first         *
  695. ;*                argument is returned.                                             *
  696. ;*                                                                                 *
  697. ;*     fmin        Returns the minimum of the two arguments.  Corresponds to the    *
  698. ;*                min function in FORTRAN.  NaN arguments are treated as missing     *
  699. ;*                data.  If one argument is NaN and the other is a number, then     *
  700. ;*                the number is returned.  If both are NaNs then the first         *
  701. ;*                argument is returned.                                            *
  702. ;*                                                                                 *
  703. ;*******************************************************************************
  704.  
  705. ;
  706. ; extern double_t fdim(double_t x, double_t y)
  707. ;
  708.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  709.         IMPORT_CFM_FUNCTION fdim
  710.     ENDIF
  711.  
  712. ;
  713. ; extern double_t fmax(double_t x, double_t y)
  714. ;
  715.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  716.         IMPORT_CFM_FUNCTION fmax
  717.     ENDIF
  718.  
  719. ;
  720. ; extern double_t fmin(double_t x, double_t y)
  721. ;
  722.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  723.         IMPORT_CFM_FUNCTION fmin
  724.     ENDIF
  725.  
  726.  
  727.  
  728. ; *******************************************************************************
  729. ;*                                Constants                                     *
  730. ;******************************************************************************
  731.  
  732.  
  733.  
  734. ; ********************************************************************************
  735. ;*                                                                                 *
  736. ;*                              Non NCEG extensions                                *
  737. ;*                                                                                 *
  738. ;*******************************************************************************
  739.  
  740.     IF TARGET_OS_MAC THEN
  741.     IF &TYPE('__NOEXTENSIONS__') = 'UNDEFINED' THEN
  742. ; ********************************************************************************
  743. ;*                                                                                 *
  744. ;*                              Financial functions                              *
  745. ;*                                                                                 *
  746. ;*     compound        Computes the compound interest factor "(1 + rate)^periods"    *
  747. ;*                      more accurately than the straightforward computation with     *
  748. ;*                    the Power function.  This is SANE's compound function.      *
  749. ;*                                                                                 *
  750. ;*     annuity            Computes the present value factor for an annuity             *
  751. ;*                      "(1 - (1 + rate)^(-periods)) /rate" more accurately than    *
  752. ;*                    the straightforward computation with the Power function.     *
  753. ;*                    This is SANE's annuity function.                              *
  754. ;*                                                                                 *
  755. ;*******************************************************************************
  756.  
  757. ;
  758. ; extern double_t compound(double_t rate, double_t periods)
  759. ;
  760.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  761.         IMPORT_CFM_FUNCTION compound
  762.     ENDIF
  763.  
  764. ;
  765. ; extern double_t annuity(double_t rate, double_t periods)
  766. ;
  767.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  768.         IMPORT_CFM_FUNCTION annuity
  769.     ENDIF
  770.  
  771.  
  772.  
  773. ; ********************************************************************************
  774. ;*                                                                                 *
  775. ;*                              Random function                                  *
  776. ;*                                                                                 *
  777. ;*     randomx            A pseudorandom number generator.  It uses the iteration:    *
  778. ;*                                (75*x)mod(2^31-1)                                *
  779. ;*                                                                                 *
  780. ;*******************************************************************************
  781.  
  782. ;
  783. ; extern double_t randomx(double_t *x)
  784. ;
  785.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  786.         IMPORT_CFM_FUNCTION randomx
  787.     ENDIF
  788.  
  789.  
  790.  
  791. ; *******************************************************************************
  792. ;*                              Relational operator                             *
  793. ;******************************************************************************
  794.  
  795. ;       relational operator      
  796. ; typedef short                         relop
  797.  
  798.  
  799. GREATERTHAN                        EQU        0
  800. LESSTHAN                        EQU        1
  801. EQUALTO                            EQU        2
  802. UNORDERED                        EQU        3
  803. ;
  804. ; extern relop relation(double_t x, double_t y)
  805. ;
  806.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  807.         IMPORT_CFM_FUNCTION relation
  808.     ENDIF
  809.  
  810.  
  811.  
  812. ; ********************************************************************************
  813. ;*                                                                                 *
  814. ;*                         Binary to decimal conversions                         *
  815. ;*                                                                                 *
  816. ;*     SIGDIGLEN    Significant decimal digits.                                        *
  817. ;*                                                                                 *
  818. ;*     decimal        A record which provides an intermediate unpacked form for        *
  819. ;*                programmers who wish to do their own parsing of numeric input     *
  820. ;*                or formatting of numeric output.                                  *
  821. ;*                                                                                 *
  822. ;*     decform        Controls each conversion to a decimal string.  The style field     *
  823. ;*                is either FLOATDECIMAL or FIXEDDECIMAL. If FLOATDECIMAL, the     *
  824. ;*                value of the field digits is the number of significant digits.  *
  825. ;*                  If FIXEDDECIMAL value of the field digits is the number of        *
  826. ;*                digits to the right of the decimal point.                         *
  827. ;*                                                                                 *
  828. ;*     num2dec        Converts a double_t to a decimal record    using a decform.        *
  829. ;*     dec2num        Converts a decimal record d to a double_t value.                *
  830. ;*     dec2str        Converts a decform and decimal to a string using a decform.        *
  831. ;*     str2dec        Converts a string to a decimal struct.                            *
  832. ;*     dec2d        Similar to dec2num except a double is returned (68k only).        *
  833. ;*     dec2f        Similar to dec2num except a float is returned.                    *
  834. ;*     dec2s        Similar to dec2num except a short is returned.                    *
  835. ;*     dec2l        Similar to dec2num except a long is returned.                     *
  836. ;*                                                                                 *
  837. ;*******************************************************************************
  838.  
  839.     IF TARGET_CPU_PPC THEN
  840.  
  841. SIGDIGLEN                        EQU        36
  842.     ELSE
  843.  
  844. SIGDIGLEN                        EQU        20
  845.     ENDIF    ; TARGET_CPU_PPC
  846.  
  847. DECSTROUTLEN                    EQU        80                    ; max length for dec2str output 
  848.  
  849. decimal                    RECORD 0
  850. sgn                         ds.b    1                ; offset: $0 (0)        ;  sign 0 for +, 1 for - 
  851. unused                     ds.b    1                ; offset: $1 (1)
  852. exp                         ds.w    1                ; offset: $2 (2)        ;  decimal exponent 
  853. sig                         ds.b    SIGDIGLEN+2        ; offset: $4 (4)        ;  significant digits (pascal string)
  854. sizeof                     EQU *                    ; size:   $1A (26) or $2A (42)
  855.                         ENDR
  856.  
  857. decform                    RECORD 0
  858. style                     ds.b    1                ; offset: $0 (0)        ;  FLOATDECIMAL or FIXEDDECIMAL 
  859. unused                     ds.b    1                ; offset: $1 (1)
  860. digits                     ds.w    1                ; offset: $2 (2)
  861. sizeof                     EQU *                    ; size:   $4 (4)
  862.                         ENDR
  863. ;
  864. ; extern void num2dec(const decform *f, double_t x, decimal *d)
  865. ;
  866.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  867.         IMPORT_CFM_FUNCTION num2dec
  868.     ENDIF
  869.  
  870. ;
  871. ; extern double_t dec2num(const decimal *d)
  872. ;
  873.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  874.         IMPORT_CFM_FUNCTION dec2num
  875.     ENDIF
  876.  
  877. ;
  878. ; extern void dec2str(const decform *f, const decimal *d, char *s)
  879. ;
  880.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  881.         IMPORT_CFM_FUNCTION dec2str
  882.     ENDIF
  883.  
  884. ;
  885. ; extern void str2dec(const char *s, short *ix, decimal *d, short *vp)
  886. ;
  887.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  888.         IMPORT_CFM_FUNCTION str2dec
  889.     ENDIF
  890.  
  891.     IF TARGET_CPU_68K THEN
  892. ;
  893. ; extern double dec2d(const decimal *d)
  894. ;
  895.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  896.         IMPORT_CFM_FUNCTION dec2d
  897.     ENDIF
  898.  
  899.     ENDIF    ; TARGET_CPU_68K
  900. ;
  901. ; extern float dec2f(const decimal *d)
  902. ;
  903.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  904.         IMPORT_CFM_FUNCTION dec2f
  905.     ENDIF
  906.  
  907. ;
  908. ; extern short dec2s(const decimal *d)
  909. ;
  910.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  911.         IMPORT_CFM_FUNCTION dec2s
  912.     ENDIF
  913.  
  914. ;
  915. ; extern long dec2l(const decimal *d)
  916. ;
  917.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  918.         IMPORT_CFM_FUNCTION dec2l
  919.     ENDIF
  920.  
  921.  
  922.  
  923.  
  924. ; ********************************************************************************
  925. ;*                                                                                 *
  926. ;*                         68k-only Transfer Function Prototypes                 *
  927. ;*                                                                                 *
  928. ;*******************************************************************************
  929.  
  930.     IF TARGET_CPU_68K THEN
  931.     IF TARGET_RT_MAC_68881 THEN
  932. ;
  933. ; extern void x96tox80(const extended96 *x, extended80 *x80)
  934. ;
  935.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION x96tox80
  937.     ENDIF
  938.  
  939. ;
  940. ; extern void x80tox96(const extended80 *x80, extended96 *x)
  941. ;
  942.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  943.         IMPORT_CFM_FUNCTION x80tox96
  944.     ENDIF
  945.  
  946.     ELSE
  947. ;
  948. ; extern void x96tox80(const extended96 *x96, extended80 *x)
  949. ;
  950.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  951.         IMPORT_CFM_FUNCTION x96tox80
  952.     ENDIF
  953.  
  954. ;
  955. ; extern void x80tox96(const extended80 *x, extended96 *x96)
  956. ;
  957.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  958.         IMPORT_CFM_FUNCTION x80tox96
  959.     ENDIF
  960.  
  961.     ENDIF    ; TARGET_RT_MAC_68881
  962.     ENDIF    ; TARGET_CPU_68K
  963.     ENDIF
  964.     ENDIF    ; TARGET_OS_MAC
  965. ; ********************************************************************************
  966. ;*                                                                                 *
  967. ;*                         PowerPC-only Function Prototypes                         *
  968. ;*                                                                                 *
  969. ;*******************************************************************************
  970.  
  971.  
  972.     IF TARGET_CPU_PPC THEN
  973. ;
  974. ; extern long double cosl(long double x)
  975. ;
  976.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  977.         IMPORT_CFM_FUNCTION cosl
  978.     ENDIF
  979.  
  980. ;
  981. ; extern long double sinl(long double x)
  982. ;
  983.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  984.         IMPORT_CFM_FUNCTION sinl
  985.     ENDIF
  986.  
  987. ;
  988. ; extern long double tanl(long double x)
  989. ;
  990.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  991.         IMPORT_CFM_FUNCTION tanl
  992.     ENDIF
  993.  
  994. ;
  995. ; extern long double acosl(long double x)
  996. ;
  997.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  998.         IMPORT_CFM_FUNCTION acosl
  999.     ENDIF
  1000.  
  1001. ;
  1002. ; extern long double asinl(long double x)
  1003. ;
  1004.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1005.         IMPORT_CFM_FUNCTION asinl
  1006.     ENDIF
  1007.  
  1008. ;
  1009. ; extern long double atanl(long double x)
  1010. ;
  1011.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1012.         IMPORT_CFM_FUNCTION atanl
  1013.     ENDIF
  1014.  
  1015. ;
  1016. ; extern long double atan2l(long double y, long double x)
  1017. ;
  1018.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1019.         IMPORT_CFM_FUNCTION atan2l
  1020.     ENDIF
  1021.  
  1022. ;
  1023. ; extern long double coshl(long double x)
  1024. ;
  1025.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1026.         IMPORT_CFM_FUNCTION coshl
  1027.     ENDIF
  1028.  
  1029. ;
  1030. ; extern long double sinhl(long double x)
  1031. ;
  1032.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1033.         IMPORT_CFM_FUNCTION sinhl
  1034.     ENDIF
  1035.  
  1036. ;
  1037. ; extern long double tanhl(long double x)
  1038. ;
  1039.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1040.         IMPORT_CFM_FUNCTION tanhl
  1041.     ENDIF
  1042.  
  1043. ;
  1044. ; extern long double acoshl(long double x)
  1045. ;
  1046.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1047.         IMPORT_CFM_FUNCTION acoshl
  1048.     ENDIF
  1049.  
  1050. ;
  1051. ; extern long double asinhl(long double x)
  1052. ;
  1053.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1054.         IMPORT_CFM_FUNCTION asinhl
  1055.     ENDIF
  1056.  
  1057. ;
  1058. ; extern long double atanhl(long double x)
  1059. ;
  1060.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1061.         IMPORT_CFM_FUNCTION atanhl
  1062.     ENDIF
  1063.  
  1064. ;
  1065. ; extern long double expl(long double x)
  1066. ;
  1067.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1068.         IMPORT_CFM_FUNCTION expl
  1069.     ENDIF
  1070.  
  1071. ;
  1072. ; extern long double expm1l(long double x)
  1073. ;
  1074.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1075.         IMPORT_CFM_FUNCTION expm1l
  1076.     ENDIF
  1077.  
  1078. ;
  1079. ; extern long double exp2l(long double x)
  1080. ;
  1081.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1082.         IMPORT_CFM_FUNCTION exp2l
  1083.     ENDIF
  1084.  
  1085. ;
  1086. ; extern long double frexpl(long double x, int *exponent)
  1087. ;
  1088.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1089.         IMPORT_CFM_FUNCTION frexpl
  1090.     ENDIF
  1091.  
  1092. ;
  1093. ; extern long double ldexpl(long double x, int n)
  1094. ;
  1095.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1096.         IMPORT_CFM_FUNCTION ldexpl
  1097.     ENDIF
  1098.  
  1099. ;
  1100. ; extern long double logl(long double x)
  1101. ;
  1102.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1103.         IMPORT_CFM_FUNCTION logl
  1104.     ENDIF
  1105.  
  1106. ;
  1107. ; extern long double log1pl(long double x)
  1108. ;
  1109.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1110.         IMPORT_CFM_FUNCTION log1pl
  1111.     ENDIF
  1112.  
  1113. ;
  1114. ; extern long double log10l(long double x)
  1115. ;
  1116.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1117.         IMPORT_CFM_FUNCTION log10l
  1118.     ENDIF
  1119.  
  1120. ;
  1121. ; extern long double log2l(long double x)
  1122. ;
  1123.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1124.         IMPORT_CFM_FUNCTION log2l
  1125.     ENDIF
  1126.  
  1127. ;
  1128. ; extern long double logbl(long double x)
  1129. ;
  1130.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1131.         IMPORT_CFM_FUNCTION logbl
  1132.     ENDIF
  1133.  
  1134. ;
  1135. ; extern long double scalbl(long double x, long n)
  1136. ;
  1137.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1138.         IMPORT_CFM_FUNCTION scalbl
  1139.     ENDIF
  1140.  
  1141. ;
  1142. ; extern long double fabsl(long double x)
  1143. ;
  1144.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1145.         IMPORT_CFM_FUNCTION fabsl
  1146.     ENDIF
  1147.  
  1148. ;
  1149. ; extern long double hypotl(long double x, long double y)
  1150. ;
  1151.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1152.         IMPORT_CFM_FUNCTION hypotl
  1153.     ENDIF
  1154.  
  1155. ;
  1156. ; extern long double powl(long double x, long double y)
  1157. ;
  1158.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1159.         IMPORT_CFM_FUNCTION powl
  1160.     ENDIF
  1161.  
  1162. ;
  1163. ; extern long double sqrtl(long double x)
  1164. ;
  1165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1166.         IMPORT_CFM_FUNCTION sqrtl
  1167.     ENDIF
  1168.  
  1169. ;
  1170. ; extern long double erfl(long double x)
  1171. ;
  1172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1173.         IMPORT_CFM_FUNCTION erfl
  1174.     ENDIF
  1175.  
  1176. ;
  1177. ; extern long double erfcl(long double x)
  1178. ;
  1179.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1180.         IMPORT_CFM_FUNCTION erfcl
  1181.     ENDIF
  1182.  
  1183. ;
  1184. ; extern long double gammal(long double x)
  1185. ;
  1186.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1187.         IMPORT_CFM_FUNCTION gammal
  1188.     ENDIF
  1189.  
  1190. ;
  1191. ; extern long double lgammal(long double x)
  1192. ;
  1193.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1194.         IMPORT_CFM_FUNCTION lgammal
  1195.     ENDIF
  1196.  
  1197. ;
  1198. ; extern long double ceill(long double x)
  1199. ;
  1200.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1201.         IMPORT_CFM_FUNCTION ceill
  1202.     ENDIF
  1203.  
  1204. ;
  1205. ; extern long double floorl(long double x)
  1206. ;
  1207.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1208.         IMPORT_CFM_FUNCTION floorl
  1209.     ENDIF
  1210.  
  1211. ;
  1212. ; extern long double rintl(long double x)
  1213. ;
  1214.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1215.         IMPORT_CFM_FUNCTION rintl
  1216.     ENDIF
  1217.  
  1218. ;
  1219. ; extern long double nearbyintl(long double x)
  1220. ;
  1221.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1222.         IMPORT_CFM_FUNCTION nearbyintl
  1223.     ENDIF
  1224.  
  1225. ;
  1226. ; extern long rinttoll(long double x)
  1227. ;
  1228.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1229.         IMPORT_CFM_FUNCTION rinttoll
  1230.     ENDIF
  1231.  
  1232. ;
  1233. ; extern long double roundl(long double x)
  1234. ;
  1235.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1236.         IMPORT_CFM_FUNCTION roundl
  1237.     ENDIF
  1238.  
  1239. ;
  1240. ; extern long roundtoll(long double round)
  1241. ;
  1242.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1243.         IMPORT_CFM_FUNCTION roundtoll
  1244.     ENDIF
  1245.  
  1246. ;
  1247. ; extern long double truncl(long double x)
  1248. ;
  1249.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1250.         IMPORT_CFM_FUNCTION truncl
  1251.     ENDIF
  1252.  
  1253. ;
  1254. ; extern long double remainderl(long double x, long double y)
  1255. ;
  1256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1257.         IMPORT_CFM_FUNCTION remainderl
  1258.     ENDIF
  1259.  
  1260. ;
  1261. ; extern long double remquol(long double x, long double y, int *quo)
  1262. ;
  1263.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1264.         IMPORT_CFM_FUNCTION remquol
  1265.     ENDIF
  1266.  
  1267. ;
  1268. ; extern long double copysignl(long double x, long double y)
  1269. ;
  1270.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1271.         IMPORT_CFM_FUNCTION copysignl
  1272.     ENDIF
  1273.  
  1274. ;
  1275. ; extern long double fdiml(long double x, long double y)
  1276. ;
  1277.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1278.         IMPORT_CFM_FUNCTION fdiml
  1279.     ENDIF
  1280.  
  1281. ;
  1282. ; extern long double fmaxl(long double x, long double y)
  1283. ;
  1284.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1285.         IMPORT_CFM_FUNCTION fmaxl
  1286.     ENDIF
  1287.  
  1288. ;
  1289. ; extern long double fminl(long double x, long double y)
  1290. ;
  1291.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1292.         IMPORT_CFM_FUNCTION fminl
  1293.     ENDIF
  1294.  
  1295.  
  1296.     IF &TYPE('__NOEXTENSIONS__') = 'UNDEFINED' THEN
  1297. ;
  1298. ; extern relop relationl(long double x, long double y)
  1299. ;
  1300.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1301.         IMPORT_CFM_FUNCTION relationl
  1302.     ENDIF
  1303.  
  1304. ;
  1305. ; extern void num2decl(const decform *f, long double x, decimal *d)
  1306. ;
  1307.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1308.         IMPORT_CFM_FUNCTION num2decl
  1309.     ENDIF
  1310.  
  1311. ;
  1312. ; extern long double dec2numl(const decimal *d)
  1313. ;
  1314.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1315.         IMPORT_CFM_FUNCTION dec2numl
  1316.     ENDIF
  1317.  
  1318.     IF TARGET_OS_MAC THEN
  1319. ;     
  1320. ;    MathLib v2 has two new transfer functions: x80tod and dtox80.  They can 
  1321. ;    be used to directly transform 68k 80-bit extended data types to double
  1322. ;    and back for PowerPC based machines without using the functions
  1323. ;    x80told or ldtox80.  Double rounding may occur. 
  1324. ;
  1325.  
  1326. ;
  1327. ; extern void x80told(const extended80 *x80, long double *x)
  1328. ;
  1329.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1330.         IMPORT_CFM_FUNCTION x80told
  1331.     ENDIF
  1332.  
  1333. ;
  1334. ; extern void ldtox80(const long double *x, extended80 *x80)
  1335. ;
  1336.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1337.         IMPORT_CFM_FUNCTION ldtox80
  1338.     ENDIF
  1339.  
  1340. ;
  1341. ; extern double x80tod(const extended80 *x80)
  1342. ;
  1343.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1344.         IMPORT_CFM_FUNCTION x80tod
  1345.     ENDIF
  1346.  
  1347. ;
  1348. ; extern void dtox80(const double *x, extended80 *x80)
  1349. ;
  1350.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1351.         IMPORT_CFM_FUNCTION dtox80
  1352.     ENDIF
  1353.  
  1354.     ENDIF    ; TARGET_OS_MAC
  1355.     ENDIF
  1356.     ENDIF    ; TARGET_CPU_PPC
  1357.     ENDIF ; __FP__ 
  1358.  
  1359.